package com.cdd.goods.controller;

import com.cdd.goods.service.IGoodsSpecificationService;
import com.cdd.goods.service.IGoodsStorageService;
import com.common.entity.GoodsStorage;
import com.common.untils.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lzl
 * @since 2022-09-01
 */
@RestController
@RequestMapping("/goods/goodsStorage")
public class GoodsStorageController {
    @Autowired
    private IGoodsStorageService iGoodsStorageService;
    @PostMapping("/selectAll/{currentPage}/{pageSize}")
    public CommonResult selectAll(@PathVariable Integer currentPage, @PathVariable Integer pageSize, @RequestBody GoodsStorage goodsStorage){
        return iGoodsStorageService.selectAll(currentPage,pageSize,goodsStorage);
    }
    @PostMapping("/select")
    public CommonResult select(){
        return iGoodsStorageService.select();
    }
    @PostMapping("/delectGoodsStorage/{id}")
    public CommonResult delectGoodsBrand(@PathVariable Integer id){
        return iGoodsStorageService.delectGoodsStorage(id);
    }
    @PostMapping("/updateGoodsStorage")
    public CommonResult updateGoodsBrand(@RequestBody GoodsStorage goodsStorage){
        return iGoodsStorageService.updateGoodsStorage(goodsStorage);
    }
    @PostMapping("/insertStorage")
    public CommonResult insertGoods(@RequestBody GoodsStorage goodsStorage){
        return iGoodsStorageService.insertStorage(goodsStorage);
    }

}
